<!--
 * @Descripttion:提醒页
 * @version:
 * @Author: ada.wu
 * @Date:2024-03-11 11:26:44
 * @LastEditors: ada.wu
 * @LastEditTime: 2024-04-11 10:59:03
-->
<template>
  <div class="hub">
    <div class="linear_bg"></div>
    <div class="m radius bg-white p t-df project_detail" v-html="activityDto.projectDetail"></div>
    <div class="fixed_bottom p-b-lg t-c">
      <van-button round color="#ffd000" @click="goUrl">开始作答</van-button>
    </div>
  </div>
</template>
<script lang="ts">
import {} from "vant";
//util
import { onMounted, reactive, toRefs, ref, nextTick } from "vue";
import { useRoute, useRouter } from "vue-router";
import { PageEnum } from "/@/enums/pageEnum";
import { useStore } from "/@/store";
//api
export default {
  name: "report",
  components: {},
  setup() {
    const store = useStore();

    const router = useRouter();
    const route = useRoute();
    let { valuatorUserId = "", activityId = "" } = route.query;

    const state = reactive({
      isQuery: false,
      activityDto: <any>{
        projectDetail: "",
      },
    });

    onMounted(async () => {
      if (activityId) {
        let res = await store.dispatch("exam/getActivityDetail", {
          activityId,
        });
        if (res && res.succ) {
          state.activityDto = res.content;
        }
      }
    });

    function goUrl() {
      router.push({
        path: PageEnum.EMPLOYEE,
        query: {
          activityId: state.activityDto.activityId,
          valuatorUserId, //评价者
        },
      });
    }
    const goBack = () => {
      router.back();
    };
    return {
      ...toRefs(state),
      goUrl,
      goBack,
    };
  },
};
</script>

<style lang="scss" scoped>
.van-button--round {
  font-weight: 500 !important;
  font-size: 16px !important;
  color: #1a1446 !important;
  width: 200px;
}
.project_detail {
  min-height: 50vh;
  max-height: 90vh;
  overflow-y: scroll;
}
</style>